const nodata = require('../tw-lib-base/no-data/props')
const commonProps = require('../tw-lib-base/chart/common-props')
// const axisProps = require('../tw-lib-base/chart/axis-props')
// const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  ...commonProps,

  // ...axisProps,
  // ...datazoomProps,
  ...tooltipProps,

  data: {
    type: Array,
    default () {
      return [
        ['姓名', '数值'],
        ['语文', 43.3],
        ['数学', 83.1],
        ['英语', 86.4],
        ['物理', 84.4]
      ]
    },
    name: '图表数据集',
    filedType: 'api'
  },

  radiusLength: {
    type: String,
    default: '50%',
    name: '饼图半径',
    filedType: 'string'
  },
  showLabel: {
    type: Boolean,
    default: false,
    name: '显示文本标签',
    filedType: 'switch'
  },
  positionLabel: {
    type: String,
    default: 'outside',
    name: '标签位置',
    filedType: 'string'
  },
  formatterLabel: {
    type: String,
    default: '{b}\n{c}\n{d}%',
    name: '标签格式',
    filedType: 'string'
  },
  triggerType: {
    type: String,
    default: 'item',
    name: '触发类型',
    filedType: 'string'
  },
  startAngle: {
    type: String,
    default: '190',
    name: '起始角度',
    filedType: 'string'
  },

  showAxis: {
    type: Boolean,
    default: false,
    name: '显示坐标轴',
    filedType: 'switch'
  },

  tooltipLabel: {
    type: String,
    default: '{b} : {c} ({d}%)',
    name: 'tooltip内容格式器',
    filedType: 'string'
  },

  showLabelFunc: {
    type: Boolean,
    default: false,
    name: '启用标签函数',
    filedType: 'switch'
  },
  funcLabel: {
    type: Function,
    default: 'function tmpinnerfunc (value) {if (params.percent < 10) { return ""; } else if (params.name.length > 4) {return params.name.substring(0, 4) + "...";} return params.name;}',
    name: '标签函数',
    filedType: 'function'
  },

  ...nodata
}
